import request from '@/utils/request';

// 采购退货订单列表
export function returnList(data) {
    return request({
        url: '/system/purchaseReturnOrder/list',
        method: 'get',
        params: data
    })
}

// 新建采购退货订单
export function returnAdd(data) {
    return request({
        url: '/system/purchaseReturnOrder/add',
        method: 'post',
        data: data
    })
}

// 编辑采购退货订单
export function returnEdit(data) {
    return request({
        url: '/system/purchaseReturnOrder/edit',
        method: 'post',
        data: data
    })
}

// 删除
export function returnDelete(id) {
    return request({
        url: '/system/purchaseReturnOrder/remove?id=' + id,
        method: 'post'
    })
}

// 获取源单产品列表
export function returnProduct(data) {
    return request({
        url: '/system/purchaseReturnOrder/getPurchaseOrderList',
        method: 'get',
        params: data
    })
}

// 根据源采购订单获取产品信息
export function returnProductOrder(data) {
    return request({
        url: '/system/purchaseReturnOrder/getOrderDetail',
        method: 'get',
        params: data
    })
}

// 获取采购退货详细信息
export function returnDetail(id) {
    return request({
        url: '/system/purchaseReturnOrder/getInfo?id=' + id,
        method: 'get'
    })
}

// 审核/反审核
export function returnAudit(data) {
    return request({
        url: '/system/purchaseReturnOrder/approve',
        method: 'post',
        data: data
    })
}